/***************************************************************************
 *            rand_test.c
 *
 *  Mon May 21 22:15:24 2007
 *  Copyright  2007  kf701
 *  Email <kf701.ye AT gmail.com>
 ****************************************************************************/


#include <unistd.h>
#include <syslog.h>
#include "kf701.h"

int main()
{
	char buf[16], hexbuf[32+1];
	printf("rand int(22,23) = %d\n", rand_int32_area(22,23));
	printf("rand int(0,255) = %d\n", rand_int32_area(0,255));
	printf("rand int(55,55) = %d\n", rand_int32_area(55,55));
	printf("rand int(-50,0) = %d\n", rand_int32_area(-50,0));
	printf("rand int(6,8) = %d\n", rand_int32_area(6,8));
	printf("rand ip = %s\n", rand_ip(buf, sizeof(buf)));

	rand_string((unsigned char *)buf, sizeof(buf));
	bin2hex( (uint8_t*)hexbuf, (uint8_t*)buf, sizeof(buf) );
	hexbuf[32] = 0;
	printf("rand str(int hex mode) = %s\n", hexbuf );

	printf("rand alpha = %c\n", rand_alpha_lower());
	printf("rand alpha = %c\n", rand_alpha_lower());
	printf("rand alpha = %c\n", rand_alpha_lower());
	
	return 0;
}
